package com.padakeji.android.ui.examples;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
 * Created by atanl on 2015/10/21.
 */
public class MainActivity extends Activity {

    private Button testPinnedHeaderListBtn;
    private Button testIconEditTextBtn;
    private Button testSwipeRefreshLayoutBtn;
    private Button testRecyclerViewBtn;
    private Button testAutoLoadRecycler;
    private Button testListViewXBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViews();

        configViews();

    }

    private void findViews() {

        testPinnedHeaderListBtn = (Button) findViewById(R.id.activity_main_btn_testPinnedHeaderList);
        testIconEditTextBtn = (Button) findViewById(R.id.activity_main_btn_testIconEditText);
        testSwipeRefreshLayoutBtn = (Button) findViewById(R.id.activity_main_btn_testSwipeRefreshLayout);
        testRecyclerViewBtn = (Button) findViewById(R.id.activity_main_btn_testRecyclerView);
        testAutoLoadRecycler = (Button) findViewById(R.id.activity_main_btn_testAutoLoadRecycler);
        testListViewXBtn = (Button) findViewById(R.id.activity_main_btn_testListViewX);

    }

    private void configViews() {
        testPinnedHeaderListBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, PinnedHeaderListTestActivity.class);
                startActivity(i);
            }
        });
        testIconEditTextBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, IconEditTextTestActivity.class);
                startActivity(i);
            }
        });

        testSwipeRefreshLayoutBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, SwipeRefreshLayoutTestActivity.class);
                startActivity(i);
            }
        });

        testRecyclerViewBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, RecyclerViewXTestActivity.class);
                startActivity(i);
            }
        });

        testAutoLoadRecycler.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, AutoLoadRecyclerTestActivity.class);
                startActivity(i);
            }
        });

        testListViewXBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, ListViewXTestActivity.class);
                startActivity(i);
            }
        });


    }


}
